<template>
  <div class="operate-bar">
    <slot name="condition"></slot>
    <div class="btn-group">
      <el-button v-if="showSearch" type="primary" @click="$emit('search')"
        >查询</el-button
      >
      <el-button
        v-if="showAdd"
        type="primary"
        icon="el-icon-plus"
        @click="$emit('add')"
        >新增</el-button
      >
      <slot name="operate"></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    showSearch: {
      type: Boolean,
      default: true,
    },
    showAdd: {
      type: Boolean,
      default: false,
    },
  },
};
</script>

<style lang="scss" scoped>
</style>